package com.feigen.controller;

import com.feigen.services.FeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: hejianding
 * @Date: 2021/3/12 9:34
 * @Version: 1.0
 */
@RestController
public class productController {
    @Autowired
    private FeignService feignService;

    @RequestMapping("/feign")
    public String testRibbon() {

        String userId = "";
        //调用10次用户微服务
        for (int i = 1; i <= 10; i++) {
            //调用定义Feign客户端方法
            userId = feignService.getUser((long) i);
        }
        return userId;
    }
}
